import request from '@/utils/request'

// 创建出库单明细
export function createShipOrderDetail(data) {
  return request({
    url: '/hs/ship-order-detail/create',
    method: 'post',
    data: data
  })
}

// 更新出库单明细
export function updateShipOrderDetail(data) {
  return request({
    url: '/hs/ship-order-detail/update',
    method: 'put',
    data: data
  })
}

// 删除出库单明细
export function deleteShipOrderDetail(id) {
  return request({
    url: '/hs/ship-order-detail/delete?id=' + id,
    method: 'delete'
  })
}

// 获得出库单明细
export function getShipOrderDetail(id) {
  return request({
    url: '/hs/ship-order-detail/get?id=' + id,
    method: 'get'
  })
}

// 获得出库单明细分页
export function getShipOrderDetailPage(params) {
  return request({
    url: '/hs/ship-order-detail/page',
    method: 'get',
    params
  })
}
// 导出出库单明细 Excel
export function exportShipOrderDetailExcel(params) {
  return request({
    url: '/hs/ship-order-detail/export-excel',
    method: 'get',
    params,
    responseType: 'blob'
  })
}

// 获得出库单明细list
export function getShipOrderDetailList(shipOrderCode) {
  return request({
    url: '/hs/ship-order-detail/list?shipOrderCode=' + shipOrderCode,
    method: 'get',
  })
}
